//
//  HeaderBgView.m
//  Camera
//
//  Created by gml on 2018/10/17.
//  Copyright © 2018年 gml. All rights reserved.
//

#import "HeaderBgView.h"
@interface HeaderBgView()
@property (nonatomic,strong) CAGradientLayer *colorLayer;
@property (weak, nonatomic) IBOutlet UIView *view2;

@end

@implementation HeaderBgView

-(void)awakeFromNib
{
    [super awakeFromNib];
    CAGradientLayer *colorLayer = [CAGradientLayer layer];
    colorLayer.colors = @[(__bridge id)[UIColor orangeColor].CGColor,(__bridge id)[UIColor redColor].CGColor];
    colorLayer.startPoint = CGPointMake(0.5, 0);
    colorLayer.endPoint = CGPointMake(1, 0);
    colorLayer.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
    [self.layer insertSublayer:colorLayer atIndex:0];
}

@end
